<?php
/**
*
* Orders table
*
* @package	VirtueMart
* @subpackage Orders
* @author RolandD
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: orders.php 3326 2011-05-22 13:14:40Z Milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

if(!class_exists('VmTable'))require(JPATH_COMPONENT.DS.'helpers'.DS.'vmtable.php');

/**
 * Orders table class
 * The class is is used to manage the orders in the shop.
 *
 * @package	VirtueMart
 * @author RolandD
 * @author Max Milbers
 */
class TableOrders extends VmTable {

	/** @var int Primary key */
	var $order_id = 0;
	/** @var int User ID */
	var $user_id = 0;
	/** @var int Vendor ID */
	var $vendor_id = 0;
	/** @var int Order number */
	var $order_number = NULL;
	/** @var int User info ID */
	var $user_info_id = NULL;
	/** @var decimal Order total */
	var $order_total = 0.00000;
	/** @var decimal Order subtotal */
	var $order_subtotal = 0.00000;
	/** @var decimal Order tax */
	var $order_tax = 0.00000;
	/** @var text Serialized tax details */
	var $order_tax_details = null;
	/** @var decimal Shipping costs */
	var $order_shipping = 0.00000;
	/** @var decimal Shipping cost tax */
	var $order_shipping_tax = 0.00000;
	/** @var decimal Coupon value */
	var $coupon_discount = 0.00000;
	/** @var string Coupon code */
	var $coupon_code = NULL;
	/** @var decimal Order discount */
	var $order_discount = 0.00000;
	/** @var string Order currency */
	var $order_currency = NULL;
	/** @var char Order status */
	var $order_status = NULL;
	/** @var char User currency id */
//	var $user_currency_id = NULL;
	/** @var char User currency rate */
//	var $user_currency_rate = NULL;
	/** @var int Payment method ID */
//	var $payment_method_id = NULL;
	/** @var int Shipping method ID */
	var $ship_method_id = NULL;
	/** @var text Customer note */
	var $customer_note = 0;
	/** @var string Users IP Address */
	var $ip_address = 0;


	/**
	 *
	 * @author Max Milbers
	 * @param $db Class constructor; connect to the database
	 *
	 */
	function __construct($db) {
		parent::__construct('#__vm_orders', 'order_id', $db);

		$this->setUniqueName('order_number');
//		$this->setObligatoryKeys('virtuemart_userinfo_id');

//		$this->setLoggable();

	}

}

